package br.ufpe.cin.imlm2.jbeat.soot.report;

import java.util.ArrayList;
import java.util.List;

import br.ufpe.cin.imlm2.util.options.Option;
import br.ufpe.cin.imlm2.util.options.Options;

public class ReportOptions extends Options {

	public static final String FULL_REPORT = "fullReport";
	public static final String REPORT_LIBRARIES = "reportLibs";
	public static final String REPORT_PATH = "reportPath";
	public static final String REPORT_CLASSES = "reportClasses";
	public static final String REPORT_PACKAGES = "reportPackages";
	public static final String DETAILED = "detailed";
	private static final String HIERARCHICAL = "hierarchical";

	public ReportOptions() {
		super();
		this.addOption(new Option(FULL_REPORT, "full",
				"If set to 'true' generates a full report", Boolean.FALSE));
		this.addOption(new Option(REPORT_LIBRARIES, "repStdLibs", "If true will also report LIBRARY " +
				"classes " ,Boolean.FALSE));
		this.addOption(new Option(REPORT_PATH, "path", "Directory path where the report(s) should" +
				" be generated.", System.getProperty("user.dir")));
		this.addOption(new Option(REPORT_CLASSES, "repClss", "List of classes that should be " +
				"included in the report.",
				new ArrayList<String>(),String.class));
		this.addOption(new Option(REPORT_PACKAGES, "repPacks", "List of packages" +
				" that should be included in the report.", new ArrayList<String>(),String.class));
		this.addOption(new Option(DETAILED, null, "Specifies if the throwable set should be reported" +
				" as a single set or as its component sets (generated,thrown,propagated,rethrown).",
				Boolean.TRUE));
		this.addOption(new Option(HIERARCHICAL, null, "Places the report for each class in a " +
				"directory hierarchy based on their package names", Boolean.TRUE));
		this.addOption(new Option("enabled", null,
				"Confirms whether or not this Transformer is enabled", Boolean.TRUE));
	}

	public boolean isFull_report() {
		return (Boolean) this.getOptionInternal(FULL_REPORT).getValue();
	}

	public boolean isReportStandardlibraries() {
		return (Boolean) this.getOptionInternal(REPORT_LIBRARIES).getValue();
	}

	public String getReport_path() {
		return (String) this.getOptionInternal(REPORT_PATH).getValue();
	}

	@SuppressWarnings("unchecked")
	public List<String> getReportClasses() {
		return (List<String>) this.getOptionInternal(REPORT_CLASSES).getValue();
	}
	
	@SuppressWarnings("unchecked")
	public List<String> getReportPackages() {
		return (List<String>) this.getOptionInternal(REPORT_PACKAGES).getValue();
	}

	public boolean isDetailed() {
		return (Boolean) this.getOptionInternal(DETAILED).getValue();
	}

	public boolean isHierarchical(){
		return (Boolean) this.getOptionInternal(HIERARCHICAL).getValue();
	}
}
